package handlers

import (
	"github.com/gin-gonic/gin"
	"lx/models"
	"net/http"
	"strconv"
)

func RoleNodeAdd(c *gin.Context) {
	rid, _ := strconv.Atoi(c.PostForm("rid"))
	nid, _ := strconv.Atoi(c.PostForm("nid"))

	rolenode := models.RoleNode{
		Rid: rid,
		Nid: nid,
	}

	models.DB.Create(&rolenode)
	c.JSON(http.StatusOK, gin.H{
		"code": "200",
		"msg":  "添加成功",
	})
	return
	
}
